{extend name="base/common"}

{block name="style"}
<link rel="stylesheet" href="__STATIC__/datepicker/bootstrap-datetimepicker.min.css">
<style>
    .shadow{width: 100%;height: 100%;position: absolute;left: 0;top: 0;background: rgba(0,0,0,0.4);z-index: 88;}
    input[name='jg'],input[name='xt'],input[name='my']{width:40px;text-align: center;margin:0 10px;}
    input[name='up'],input[name='float'],input[name='low'],input[name='work'],input[name='style'],input[name='area'],input[name='twin'],input[name='three'],input[name='develop'],input[name='other'] {width:40px;text-align: center;margin:0 10px;}
    .minus,.add,.add1,.add2 b,.add4 b,.add5 b,.add6 b,.add7 b, .add8 b , .add9 b{cursor: pointer;display: inline-block;
        width: 20px;
        text-align: center;}
    .table tr th,.table tr td{
        text-align: center;
    }
    .table tr th:nth-child(2),.table tr td:nth-child(2){
        text-align: left;
    }
</style>

{/block}

{block name="page-header"}
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>学校排名</h2>
        <ol class="breadcrumb">
            <li>
                <a href="{:Url('Rank/index')}">签到、总结、作业</a>
            </li>
            <li class="active">
                <strong>排行榜</strong>
            </li>
        </ol>
    </div>
    <div class="col-lg-2">
    </div>
</div>
{/block}

{block name="main"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5 style="color: green">*注：完成率为 0 的将不再展示</h5>
                    <form method="get" action="">
                        <div class="col-sm-3" style="width: 50%">
                            <div class="input-group" >
                                <input type="text" placeholder="根据时间筛选" class="input-sm form-control datetimepicker" name="time"  value="{notempty name='Think.get.time'}{$Think.get.time}{/notempty}"/>
                                <input type="hidden" name="type"  value="{$type}"/>
                            <span class="input-group-btn">
                                <button type="submit" class="btn btn-sm btn-primary">查询</button>
                            </span>
                            </div>
                        </div></form>
                    <div class="ibox-tools">
                        <select name="type" style="width: 20%;height: 35px" onchange="changeType()">
                            {empty name="type"}
                            <option value="1" selected >每日签到</option>
                            <option value="2" >总结提交</option>
                            <option value="3" >作业提交</option>
                            {else/}
                            <option value="1" {eq name="$type" value="1"}selected {/eq} >每日签到</option>
                            <option value="2" {eq name="$type" value="2"}selected {/eq}>总结提交</option>
                            <option value="3" {eq name="$type" value="3"}selected {/eq}>作业提交</option>
                            {/empty}
                        </select>
                    </div>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="table-responsive">
                        <div  style="padding-right:17px">
                            <table class="table table-striped">
                                <tr>
                                    <th width="10%" style="color: red">排名</th>
                                    <th width="20%">学校ID</th>
                                    <th width="40%">学校名称</th>
                                    <th width="20%">完成数/总数</th>
                                    <th width="10%" style="color: red">完成率</th>
                                </tr>
                            </table>
                        </div>
                        <div style="width:100%;height:600px;overflow:auto; border-bottom:1px solid #dddddd">
                            <table class="table table-striped">
                                <tbody>
                                {volist name="list" id="vo"}
                                <tr>
                                    <td width="10%" style="color: red">{$i}</td>
                                    <td width="20%">{$vo.school_id}</td>
                                    <td width="40%">{$vo.school_id|get_school}</td>
                                    <td width="20%">{$vo.num}/{$vo.sum}</td>
                                    <td width="10%" style="color: red">{$vo.percent} %</td>
                                </tr>
                                {/volist}
                                </tbody>
                            </table>
                        </div>
                        <tfoot>
                        <tr>
                            <td colspan="10">
                            </td>
                        </tr>
                        </tfoot>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<iframe id="iframe" src="" style="height: 80%;width: 392px;z-index: 99;position: absolute;top: 10%;border: 0;left: 32%;background: #fff;display: none;" scrolling="auto" seamless></iframe>
<div class="shadow" style="display: none"></div>
{/block}

{block name="script"}
<script src="/admin/js/plugins/iCheck/icheck.min.js"></script>
<script src="__STATIC__/datepicker/bootstrap-datetimepicker.js"></script>
<script>
    highlight_subnav("{:Url('Rank/index')}");
    $(document).ready(function(){
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
    });
    //    时间日历
    $( ".datetimepicker" ).datetimepicker( {
        language:  'cn',
        format: 'yyyy-mm-dd',
        minView: "month",
        forceParse: false,
        todayBtn: true,
        autoclose: true,
        todayHighlight: 1,
        minuteStep: 5

    });
    function changeType(){
        var types = $("select[name='type']").val();
        var time = $("input[name='time']").val();
        if (time == ''){
            location.href = "{:Url('Rank/index')}?type="+types;
        }else{
            location.href = "{:Url('Rank/index')}?type="+types+"&time="+time;
        }
    }
    var typess = $("select[name='type']").val();
    document.getElementById('type').value = typess;
</script>
{/block}